﻿///*
//**诉讼详情
//*/
Chenxin.UI.ShowDetailLitigationPage = Chenxin.extend(Chenxin.UI.AddPageCommon,{
    actionUrl:"/service/logic/ShowDetailLitigation.ashx",
    createForm:function(){
        return new Chenxin.UI.ShowDetailLitigationForm({
            scope:this
        });
    },
});
Chenxin.UI.ShowDetailLitigationForm = Chenxin.extend(Chenxin.UI.AddFormCommon,{
    actionUrl: "/service/logic/ShowDetailLitigation.ashx",
    id: "ShowDetail_form",
	loadinfo: function() {
        var _this = this;
        if (!this.currentId) {
            alert("请先选择一条记录！");
            return false;
        }
        Chenxin.ajax({
            type: "get",
            dataType: "text",
            paramType: 'json',
            async: false,
            url: this.actionUrl,
            data: { op: 'getmodel', modelid: this.currentId },
            onSuccess: function(data, msg) {
                if (data) {
                    _this.currentInfo = data;
                }
            }
        });
        return true;
    },
    loadsubinfo: function() {
        var _this = this;
        if (!this.currentId) {
            alert("请先选择一条记录！");
            return false;
        }
        Chenxin.ajax({
            type: "get",
            dataType: "text",
            paramType: 'json',
            async: false,
            url: this.actionUrl,
            data: { op: 'getsubmodel', modelid: this.currentId },
            onSuccess: function(data, msg) {
                if (data) {
                    _this.currentSubInfo = data;
                }
            }
        });
        return true;
    },
	initForm:function() {
		_this = this;
		var recordId = Chenxin.Fn.getQueryString("RecordId");
		if(recordId == null || recordId.isBlank()) {
			alert('参数格式错误,加载失败！');
			return ;
		}
		_this.currentId = recordId;
		_this.loadinfo();
		_this.loadsubinfo();
    },
    initEvent: function() {
        /*************事件：关闭*************/
        $('#aClose').live('click', function() {
            window.close();
        });
    },
    loadDefVal:function(){
		_this = this;;
		if(_this.currentInfo != undefined)
        {
            Chenxin.Fn.BindData(_this.currentInfo);
            switch(_this.currentInfo.Status)
            {
                case -10:
                    $('#Status').html("审核未通过，不予诉讼");
                    break;
                case 0:
                    $('#Status').html("诉讼申请，待审核");
                    break;
                case 10:
                    $('#Status').html("审核通过予以诉讼");
                    break;
                case 20:
                    $('#Status').html("立案审理中");
                    break;
                case 30:
                    $('#Status').html("已裁决，执行中");
                    break;
                case 40:
                    $('#Status').html("已结案");
                    break;
            }
        }
        
		if(_this.currentSubInfo != undefined)
        {
            $('#FirstTrialDate').html(_this.currentSubInfo.FirstTrialDate);
            $('#FirstTrialCourt').html(_this.currentSubInfo.FirstTrialCourt);
            $('#FirstTrialJudge').html(_this.currentSubInfo.FirstTrialJudge);
            $('#FirstTrialMemo').html(_this.currentSubInfo.FirstTrialMemo);
            $('#SecTrialDate').html(_this.currentSubInfo.SecTrialDate);
            $('#SecTrialCourt').html(_this.currentSubInfo.SecTrialCourt);
            $('#SecTrialJudge').html(_this.currentSubInfo.SecTrialJudge);
            $('#SecTrialMemo').html(_this.currentSubInfo.SecTrialMemo);
            $('#LastTrialDate').html(_this.currentSubInfo.LastTrialDate);
            $('#LastTrialCourt').html(_this.currentSubInfo.LastTrialCourt);
            $('#LastTrialJudge').html(_this.currentSubInfo.LastTrialJudge);
            $('#LastTrialMemo').html(_this.currentSubInfo.LastTrialMemo);
        }
	}
});

getcity = true; //设置需要获取城市下拉框数据

$(document).ready(function() {
    var showdetaillitigationpage = new Chenxin.UI.ShowDetailLitigationPage();
});